package com.golxen.framework.common.server.game.sync.message;




import com.golxen.utils.LogUtil;

import java.util.HashMap;
import java.util.Map;

public class GameSyncCmdService {

	
	private  final Map<Integer, IGameServiceCommand> gameServiceCommandHashMap = new HashMap<>();

    public IGameServiceCommand getCommand(int code) {
        try {
            return gameServiceCommandHashMap.get(code);
        } catch (Exception e) {
            LogUtil.COMMON.error("获取 Command 异常, Command Code: {}", code, e);
            return null;
        }
    }

    public void addGameServiceCommand(int code, IGameServiceCommand iGameServiceCommand) {
        gameServiceCommandHashMap.put(code, iGameServiceCommand);
    }

}
